package cn.smbms.pojo;


import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;


import java.util.Date;

public class User {

  private Integer id;
  private String userCode;
  private String userName;
  private String userPassword;
  private Integer gender;
  @DateTimeFormat(pattern = "yyyy-MM-dd") // springmvc提供的 apache
  //@JSONField(format = "yyyy-MM-dd") // albb fastJSON提供的
  private java.util.Date birthday;
  private String phone;
  private String address;
  private Integer userRole;
  private Integer createdBy;
  private java.util.Date creationDate;
  private Integer modifyBy;
  private java.util.Date modifyDate;
  private String userRoleName;
  private  String idPicPath;

  @Override
  public String toString() {
    return "User{" +
            "id=" + id +
            ", userCode='" + userCode + '\'' +
            ", userName='" + userName + '\'' +
            ", userPassword='" + userPassword + '\'' +
            ", gender=" + gender +
            ", birthday=" + birthday +
            ", phone='" + phone + '\'' +
            ", address='" + address + '\'' +
            ", userRole=" + userRole +
            ", createdBy=" + createdBy +
            ", creationDate=" + creationDate +
            ", modifyBy=" + modifyBy +
            ", modifyDate=" + modifyDate +
            ", userRoleName='" + userRoleName + '\'' +
            ", idPicPath='" + idPicPath + '\'' +
            ", age=" + age +
            '}';
  }

  public String getIdPicPath() {
    return idPicPath;
  }

  public void setIdPicPath(String idPicPath) {
    this.idPicPath = idPicPath;
  }

  private Integer age;

  public Integer getAge() {

    return new Date().getYear() - birthday.getYear();
  }

  public void setAge(Integer age) {
    this.age = age;
  }

  public String getUserRoleName() {
    return userRoleName;
  }

  public void setUserRoleName(String userRoleName) {
    this.userRoleName = userRoleName;
  }

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }


  public String getUserCode() {
    return userCode;
  }

  public void setUserCode(String userCode) {
    this.userCode = userCode;
  }


  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }


  public String getUserPassword() {
    return userPassword;
  }

  public void setUserPassword(String userPassword) {
    this.userPassword = userPassword;
  }


  public Integer getGender() {
    return gender;
  }

  public void setGender(Integer gender) {
    this.gender = gender;
  }


  public java.util.Date getBirthday() {
    return birthday;
  }

  public void setBirthday(java.util.Date birthday) {
    this.birthday = birthday;
  }


  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }


  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }


  public Integer getUserRole() {
    return userRole;
  }

  public void setUserRole(Integer userRole) {
    this.userRole = userRole;
  }


  public Integer getCreatedBy() {
    return createdBy;
  }

  public void setCreatedBy(Integer createdBy) {
    this.createdBy = createdBy;
  }


  public java.util.Date getCreationDate() {
    return creationDate;
  }

  public void setCreationDate(java.util.Date creationDate) {
    this.creationDate = creationDate;
  }


  public Integer getModifyBy() {
    return modifyBy;
  }

  public void setModifyBy(Integer modifyBy) {
    this.modifyBy = modifyBy;
  }


  public java.util.Date getModifyDate() {
    return modifyDate;
  }

  public void setModifyDate(java.util.Date modifyDate) {
    this.modifyDate = modifyDate;
  }

}
